package com.hotelsystem.pojo;

import java.util.List;

public class RoomType {
    private Integer roomTypeId;

    private String typeName;

    private Integer price;

    private Integer bedNum;

    private Integer roomNum;

    private Integer usable;

    private Integer reserved;

    private Integer checkIn;

    private Integer status;

    private List<Room> rooms;

    public Integer getRoomTypeId() {
        return roomTypeId;
    }

    public void setRoomTypeId(Integer roomTypeId) {
        this.roomTypeId = roomTypeId;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName == null ? null : typeName.trim();
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public Integer getBedNum() {
        return bedNum;
    }

    public void setBedNum(Integer bedNum) {
        this.bedNum = bedNum;
    }

    public Integer getRoomNum() {
        return roomNum;
    }

    public void setRoomNum(Integer roomNum) {
        this.roomNum = roomNum;
    }

    public Integer getUsable() {
        return usable;
    }

    public void setUsable(Integer usable) {
        this.usable = usable;
    }

    public Integer getReserved() {
        return reserved;
    }

    public void setReserved(Integer reserved) {
        this.reserved = reserved;
    }

    public Integer getCheckIn() {
        return checkIn;
    }

    public void setCheckIn(Integer checkIn) {
        this.checkIn = checkIn;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public List<Room> getRooms() {
        return rooms;
    }

    public void setRooms(List<Room> rooms) {
        this.rooms = rooms;
    }

    @Override
    public String toString() {
        return "RoomType{" +
                "roomTypeId=" + roomTypeId +
                ", typeName='" + typeName + '\'' +
                ", price=" + price +
                ", bedNum=" + bedNum +
                ", roomNum=" + roomNum +
                ", usable=" + usable +
                ", reserved=" + reserved +
                ", checkIn=" + checkIn +
                ", status=" + status +
                '}';
    }

    /**
     * 如果类型名称相同就是同一个对象
     * @param o
     * @return
     */
    @Override
    public boolean equals(Object o) {
        if (o == null) return false;
        if (o instanceof RoomType){
            RoomType roomType = (RoomType)o;
            return roomType.getTypeName().equals(getTypeName());
        }
        return false;
    }

    /**
     * 为了让其调用equals方法此处写1
     * 开发中不要这么写
     * @return
     */
    @Override
    public int hashCode() {
        return 1;
    }
}